#ifndef _SERVER_H_
#define _SERVER_H_

#include "common/common.h"
#include "json/json-usr.h"


namespace iecas_ns
{
    class CServer
    {
        #define MAX_QUE_CONN_NUM	20
        #define MAXDATASIZE 128

		public:
			static shared_ptr<CServer> getInstance();
            CServer();
			bool init(void);
            void start(void);
		private:
			static shared_ptr<CServer> sm_intancePtr;
            int server_fd;
            struct sockaddr_in server_sockaddr;
            void loop(void);
            void do_service(string client_ip, int client_fd);
            shared_ptr<CCommon> m_commonPtr;
            shared_ptr<CJsonUsr> m_jsonUsrPtr;
    };
}

#endif